#include "Data.h"
#include <iostream>
namespace binge
{

Data::Data(void)
{

}

Data::~Data(void)
{
    objectsId.clear();
}

int
Data::GetCount(void)
{
    return objectsId.size();
}

int
Data::GetIndex(int id)
{
    int index = 0;
    std::vector<int>::iterator it;
    for(it = objectsId.begin(); it != objectsId.end(); it++)
    {
        if(*it == id)
        {
            return index;
        }
        index++;
    }
    return -1; // Return -1 if object doesn't exist
}

int
Data::GetIdByIndex(int index)
{
    return objectsId[index];
}

bool
Data::Has(int id)
{
    std::vector<int>::iterator it;
    for(it = objectsId.begin(); it != objectsId.end(); it++)
    {
        if(*it == id)
        {
            return true;
        }
    }
    return false;
}

} // namespace
